import pandas as pd
import requests
import io


def download_file(file):
    data = pd.read_csv(file)
    print(data.head())
    for idx,item in data.iterrows():
        title = item['title']
        link = item['link']

        print(title,link) 

        response = requests.get(link)



        pdf = io.BytesIO(response.content)


        with open(title + '.pdf', 'wb') as f:
            f.write(pdf.read())

file1 = 'smartedu-1.csv'

download_file(file1)